package com.gupao.observerdemo.observer.mouse;

import com.gupao.observerdemo.observer.core.EventListener;
import lombok.extern.slf4j.Slf4j;

/**
 * 被观察者
 * 发生改变（执行方法）会触发事件
 */
@Slf4j
public class Mouse extends EventListener {
    public void click(){
        log.info("鼠标单击");
        //触发事件
        trigger(MouseEventType.ON_CLICK);
    }
    public void doubleClick(){
        log.info("鼠标双击");
    }
    public void move(){
        log.info("鼠标移动");
    }
}
